<?php
header('Content-type: text/html; charset=utf-8');
echo '<pre>';
var_dump ( $_POST );
echo '</pre><pre>';
var_dump ( $_GET );
echo '</pre>';
if ($_POST ['post_back']==1) {
	$data = $_POST;

	$data['56st'] = $_GET['56st'];
	$data['tax'] = md5($_POST['vid'].'sd+#dlpm^*sdf4'.$data['56st']);
	
	
	$fp = fsockopen('ww.56.com', 80, $errno, $errstr, 3);
		if(is_array($data)) {
			$Content =array();
			foreach($data as $k=>$v)
			{
				$Content[] = $k."=".rawurlencode ($v);
			}
			$Content = implode("&",$Content);
		}else {
			$Content = $data;
		}
		
		//$stream
		$stream = "POST /r/api/uinfo.php HTTP/1.0\r\n";
		$stream .= "Content-Type: application/x-www-form-urlencoded\r\n";
		$stream .= "Host: ww.56.com\r\n";
		$stream .= "Content-Length: ".strlen($Content)."\r\n";
		$stream .= "Connection: Close\r\n";
		$stream .= "\r\n";
			
		fwrite($fp, $stream);
		usleep(10);
		fwrite($fp, $Content);
		stream_set_timeout($fp, 3);
		$res = stream_get_contents($fp);
		$info = stream_get_meta_data($fp);
		fclose($fp);
		//echo $stream;
		if ($info['timed_out']) {
			die('time out');
		}else {
			var_dump( substr(strstr($res, "\r\n\r\n"),4) );
		}
	
}
var_dump($data['tax']);
?>
<?php if ($_GET['pic']) {?>
	<img src="<?=$_GET['pic'];?>" alt="" />
<?php }?>
<form method="POST" id="post_back_form">
<input type="hidden" name="post_back" value="1">
	<input type="text" name="vid" value="<?=$_GET['vid'];?>"> <input
		type="text" name="Subject" value="Subject"><input type="text"
		name="Content" value="Content"><input type="text" name="tag"
		value="tag"> <input type="submit" value="提交">
</form>
